<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Simpla Admin</title>
        <!--                       CSS                       -->
        <!-- Reset Stylesheet -->
        <link rel="stylesheet" href="/Public/resources/css/reset.css" type="text/css" media="screen" />
        <!-- Main Stylesheet -->
        <link rel="stylesheet" href="/Public/resources/css/style.css" type="text/css" media="screen" />
        <!-- Invalid Stylesheet. This makes stuff look pretty. Remove it if you want the CSS completely valid -->
        <link rel="stylesheet" href="/Public/resources/css/invalid.css" type="text/css" media="screen" />
        <!--                       Javascripts                       -->
        <!-- jQuery -->
        <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.js"></script>
        <!-- Facebox jQuery Plugin -->
        <script type="text/javascript" src="/Public/resources/scripts/facebox.js"></script>
        <!-- jQuery Configuration -->
        <script type="text/javascript" src="/Public/resources/scripts/simpla.jquery.configuration.js"></script>
        <script type="text/javascript" src="/Public/ueditor/editor_config.js"></script>
        <script type="text/javascript" src="/Public/ueditor/editor_all.js"></script>
        <literal>
            
        </literal>
    </head>
    <body>
        <div id="body-wrapper">
            <!-- Wrapper for the radial gradient background -->
            <div id="sidebar">
                <div id="sidebar-wrapper">
                    <!-- Sidebar with logo and menu -->
                    <h1 id="sidebar-title"><a href="#">Simpla Admin</a></h1>
                    <!-- Logo (221px wide) -->
                    <a href="/index.php"><img id="logo" src="/Public/resources/images/logo.png" alt="Simpla Admin logo" /></a>
                    <!-- Sidebar Profile links -->
                    <div id="profile-links"> Hello, <a href="#" title="Edit your profile">{@username}</a><br />
                        <br />
                        <a href="#" title="View the Site">Welcome</a> | <a href="__APP__/Admin/Index/logout" title="Sign Out">退出</a> </div>
                    <ul id="main-nav">
                        <!-- Accordion Menu -->
                        <?php
                            if($menu){
                                foreach($menu as $name=>$info){
                                    $submenu = '';
                                    list($module,$action) = explode('/',$info['route']);
                                    if(isset($info['submenu']) && !empty($info['submenu'])){
                                        $submenu .= '<ul>';
                                        
                                        foreach($info['submenu'] as $sname=>$subinfo){
                                            $current='';
                                            $route = MODULE_NAME.'/'.ACTION_NAME;
                                            if($subinfo['route'] == $route){
                                                $current = 'current';
                                            }
                                            $submenu .= "<li><a href=".$subinfo['url']." class=$current>$sname</a></li>";
                                        }
                                        $submenu .= '</ul>';
                                    }
                                    $current='';
                                    if($module == MODULE_NAME){
                                       $current = 'current';
                                    }
                                    if($submenu){
                                        echo "<li><a href=".$info['url']." class='nav-top-item $current'>$name</a>$submenu</li>";
                                    }else{
                                        echo "<li><a href=".$info['url']." class='nav-top-item no-submenu $current'>$name</a></li>";
                                    }
                                    
                                    
                                }
                            }
                        ?>
                    </ul>
                    <!-- End #main-nav -->
                </div>
            </div>
            <!-- End #sidebar -->